#ifndef DEMO_H
#define DEMO_H

#pragma warning(disable:4786)

#include <string>
#include <vector>
#include "Block.h"

class Script;



class Demo  
{
public:
	Demo();
	~Demo();

	bool Load(std::string Filename);
	bool Save(std::string Filename);
	void MarkFirstBlock();
	void MarkLastBlock();
	
	Block& GetCurrentBlock();

	void Progress(int& Speed,float &Time,bool NextTime = true);
	
	float GetFirstTime();
	float GetLastTime();

	bool Recam(Script& S, Demo& Out);

	void SnapToTime(float Time);

	void RenumberEntity(int OldId, int NewId);
	void ShiftEntity(int Id, int Offset[3]);
	void MergeInto(Demo* pOther,int ClientNumber);
	void ShiftStats(int ClientNumber);
private:
	void Forward(int& Speed,bool NextTime);
	void Backward(int& Speed,bool NextTime);

	typedef std::vector<Block>::iterator BlockIt;
	std::vector<Block>		m_RawBlocks;
	int						m_CurrBlock;
	int						m_FirstBlock;
	int						m_LastBlock;
};



#endif 
